<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改房间类型')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-category-edit" th:object="${roomCategory}">
            <input name="categoryId" th:field="*{categoryId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型名称：</label>
                <div class="col-sm-8">
                    <input name="categoryName" th:field="*{categoryName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">费用价格：</label>
                <div class="col-sm-8">
                    <input name="price" th:field="*{price}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">房型总量：</label>
                <div class="col-sm-8">
                    <input name="totalNum" th:field="*{totalNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">余量：</label>
                <div class="col-sm-8">
                    <input name="leftNum" th:field="*{leftNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否有余量：</label>
                <div class="col-sm-8">
                    <select name="isLeft" class="form-control m-b" th:with="type=${@dict.getType('is_left')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isLeft}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="categoryComment" th:field="*{categoryComment}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/category";
        $("#form-category-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-category-edit').serialize());
            }
        }
    </script>
</body>
</html>